﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Season.aspx.cs" Inherits="Trangtrai.cauhinhsanxuat.Season"
    MasterPageFile="~/SiteMaster.Master" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <script type="text/javascript" src="js/jquery-latest.js"></script>
    <center>
        <table width="960px" style="border: thin solid #94B6EF">
            <tr>
                <td>
                    <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
                      KeyFieldName="SEASON_ID" Width="960px" CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" CssPostfix="Office2003Blue">
                        <Styles CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" CssPostfix="Office2003Blue">
                            <Header ImageSpacing="5px" SortingImageSpacing="5px">
                            </Header>
                            <LoadingPanel ImageSpacing="10px">
                            </LoadingPanel>
                        </Styles>
                        <SettingsPager>
                            <AllButton Text="All">
                            </AllButton>
                            <NextPageButton Text="Next &gt;">
                            </NextPageButton>
                            <PrevPageButton Text="&lt; Prev">
                            </PrevPageButton>
                        </SettingsPager>
                        <ImagesFilterControl>
                            <LoadingPanel Url="~/App_Themes/Office2003Blue/Editors/Loading.gif">
                            </LoadingPanel>
                        </ImagesFilterControl>
                        <Images SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                            <LoadingPanelOnStatusBar Url="~/App_Themes/Office2003Blue/GridView/gvLoadingOnStatusBar.gif">
                            </LoadingPanelOnStatusBar>
                            <LoadingPanel Url="~/App_Themes/Office2003Blue/GridView/Loading.gif">
                            </LoadingPanel>
                        </Images>
                        <SettingsEditing PopupEditFormAllowResize="True" />
                        <Columns>
                            <dx:GridViewDataTextColumn Caption="Tên vụ" FieldName="SEASON_NAME" VisibleIndex="0">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataDateColumn Caption="Từ ngày" FieldName="START_DATE" VisibleIndex="1">
                            </dx:GridViewDataDateColumn>
                            <dx:GridViewDataDateColumn Caption="Đến ngày" FieldName="END_DATE" VisibleIndex="2">
                            </dx:GridViewDataDateColumn>
                            <dx:GridViewCommandColumn ButtonType="Image" Caption="Xóa" VisibleIndex="5">
                                <DeleteButton Visible="True">
                                    <Image Url="~/Image/delete.PNG">
                                    </Image>
                                </DeleteButton>
                                <ClearFilterButton Visible="True">
                                </ClearFilterButton>
                            </dx:GridViewCommandColumn>
                            <dx:GridViewCommandColumn ButtonType="Image" Caption="Sửa" VisibleIndex="4">
                                <EditButton Visible="True">
                                    <Image Url="~/Image/modify.PNG">
                                    </Image>
                                </EditButton>
                                <CancelButton>
                                    <Image Url="~/Image/delete.PNG">
                                    </Image>
                                </CancelButton>
                                <UpdateButton>
                                    <Image Url="~/Image/save.PNG">
                                    </Image>
                                </UpdateButton>
                                <ClearFilterButton Visible="True">
                                </ClearFilterButton>
                            </dx:GridViewCommandColumn>
                            <dx:GridViewDataTextColumn FieldName="NOTE" VisibleIndex="3" Caption="Ghi chú">
                            </dx:GridViewDataTextColumn>
                        </Columns>
                        <Settings ShowFilterRow="True" ShowGroupPanel="True" />
                        <SettingsEditing PopupEditFormHorizontalAlign="Center" PopupEditFormWidth="600px" Mode="PopupEditForm" />
                        <StylesEditors>
                            <ProgressBar Height="25px">
                            </ProgressBar>
                        </StylesEditors>
                    </dx:ASPxGridView>
                </td>
            </tr>
            <tr>
                <td align="left" bgcolor="White" class="style2">
                    <dx:ASPxButton ID="ASPxButton1" runat="server" Text="+ Thêm mới" CssFilePath="~/App_Themes/SoftOrange/{0}/styles.css"
                        CssPostfix="SoftOrange" SpriteCssFilePath="~/App_Themes/SoftOrange/{0}/sprite.css"
                        OnClick="ASPxButton1_Click1">
                    </dx:ASPxButton>
                </td>
            </tr>
        </table>
    </center>
    <center>
        <table width="800px" id="table" visible="false" runat="server" style="border: thin solid #5296EF;"
            bgcolor="White">
            <tr>
                <td bgcolor="#94B6EF" colspan="5" align="center">
                    <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Thêm vụ mới" Font-Bold="false"
                        ForeColor="Black" Font-Size="Large">
                    </dx:ASPxLabel>
                </td>
            </tr>
            <tr>
                <td colspan="5">
                    <br />
                </td>
            </tr>
            <tr>
                <td bgcolor="#94B6EF" class="style3" align="left">
                    <dx:ASPxLabel ID="ASPxLabel4" runat="server" Text="Tên vụ mới" ForeColor="Black">
                    </dx:ASPxLabel>
                </td>
                <td class="style1">
                </td>
                <td class="style8" align="left" colspan="2">
                    <dx:ASPxTextBox ID="tbxName" runat="server" Width="170px" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
                        CssPostfix="Aqua" SpriteCssFilePath="~/App_Themes/Aqua/{0}/sprite.css">
                        <ValidationSettings>
                            <ErrorFrameStyle ImageSpacing="4px">
                                <ErrorTextPaddings PaddingLeft="4px" />
                            </ErrorFrameStyle>
                        </ValidationSettings>
                    </dx:ASPxTextBox>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td colspan="5">
                    <br />
                </td>
            </tr>
            <tr>
                <td bgcolor="#94B6EF" class="style3" align="left">
                    <dx:ASPxLabel ID="ASPxLabel6" runat="server" Text="Từ ngày" ForeColor="Black">
                    </dx:ASPxLabel>
                </td>
                <td class="style1">
                </td>
                <td class="style14" align="left" colspan="2">
                    <dx:ASPxDateEdit ID="dateFrom" runat="server" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
                        CssPostfix="Aqua" ShowShadow="False" SpriteCssFilePath="~/App_Themes/Aqua/{0}/sprite.css">
                        <DropDownButton>
                            <Image>
                                <SpriteProperties HottrackedCssClass="dxEditors_edtDropDownHover_Aqua" PressedCssClass="dxEditors_edtDropDownPressed_Aqua" />
                            </Image>
                        </DropDownButton>
                        <CalendarProperties>
                            <HeaderStyle Spacing="1px" />
                            <FooterStyle Spacing="17px" />
                        </CalendarProperties>
                        <ValidationSettings>
                            <ErrorFrameStyle ImageSpacing="4px">
                                <ErrorTextPaddings PaddingLeft="4px" />
                            </ErrorFrameStyle>
                        </ValidationSettings>
                    </dx:ASPxDateEdit>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="5">
                    <br />
                </td>
            </tr>
            <tr>
                <td bgcolor="#94B6EF" class="style3" align="left">
                    <dx:ASPxLabel ID="ASPxLabel7" runat="server" Text="Đến ngày" ForeColor="Black">
                    </dx:ASPxLabel>
                </td>
                <td class="style1">
                </td>
                <td class="style14" align="left">
                    <dx:ASPxDateEdit ID="dateTo" runat="server" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
                        CssPostfix="Aqua" ShowShadow="False" SpriteCssFilePath="~/App_Themes/Aqua/{0}/sprite.css">
                        <DropDownButton>
                            <Image>
                                <SpriteProperties HottrackedCssClass="dxEditors_edtDropDownHover_Aqua" PressedCssClass="dxEditors_edtDropDownPressed_Aqua" />
                            </Image>
                        </DropDownButton>
                        <CalendarProperties>
                            <HeaderStyle Spacing="1px" />
                            <FooterStyle Spacing="17px" />
                        </CalendarProperties>
                        <ValidationSettings>
                            <ErrorFrameStyle ImageSpacing="4px">
                                <ErrorTextPaddings PaddingLeft="4px" />
                            </ErrorFrameStyle>
                        </ValidationSettings>
                    </dx:ASPxDateEdit>
                </td>
                <td class="style13">
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="5">
                    <br />
                </td>
            </tr>
            <tr>
                <td bgcolor="#94B6EF" class="style3" align="left">
                    <dx:ASPxLabel ID="ASPxLabel5" runat="server" Text="Ghi chú" ForeColor="Black">
                    </dx:ASPxLabel>
                </td>
                <td class="style1">
                </td>
                <td class="style8" align="left" colspan="2">
                    <dx:ASPxMemo ID="tbxNote" runat="server" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
                        CssPostfix="Aqua" Height="86px" SpriteCssFilePath="~/App_Themes/Aqua/{0}/sprite.css"
                        Width="314px">
                        <ValidationSettings>
                            <ErrorFrameStyle ImageSpacing="4px">
                                <ErrorTextPaddings PaddingLeft="4px" />
                            </ErrorFrameStyle>
                        </ValidationSettings>
                    </dx:ASPxMemo>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td colspan="5" align="left">
                    <dx:ASPxButton ID="btnSave" runat="server" Visible="false" CssFilePath="~/App_Themes/SoftOrange/{0}/styles.css"
                        CssPostfix="SoftOrange" SpriteCssFilePath="~/App_Themes/SoftOrange/{0}/sprite.css"
                        Text="Lưu" Width="78px" OnClick="btnSave_Click">
                    </dx:ASPxButton>
                </td>
            </tr>
        </table>
    </center>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TOM_MSConnectionString %>"
        SelectCommand="SELECT [SEASON_NAME], [START_DATE], [END_DATE], [NOTE],[SEASON_ID] FROM [SEASON]" 
        
        
        UpdateCommand="UPDATE SEASON SET SEASON_NAME = @SEASON_NAME, START_DATE = @START_DATE, END_DATE = @END_DATE, NOTE = @NOTE WHERE (SEASON_ID = @SEASON_ID)" 
        DeleteCommand="DELETE FROM SEASON WHERE SEASON_ID = @SEASON_ID">
        <DeleteParameters>
            <asp:Parameter Name="SEASON_ID" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="SEASON_NAME" Type="String" />
            <asp:Parameter Name="START_DATE" Type="DateTime" />
            <asp:Parameter Name="END_DATE" Type="DateTime" />
            <asp:Parameter Name="NOTE" Type="String" />
            <asp:Parameter Name="SEASON_ID" Type="Int32" />
        </UpdateParameters>

    </asp:SqlDataSource>
    <br />
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="head">
    <script type="text/javascript" src="../../js/jquery-latest.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {

            $("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav

            $("ul.topnav li span").click(function () { //When trigger is clicked...

                //Following events are applied to the subnav itself (moving subnav up and down)
                $(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

                $(this).parent().hover(function () {
                }, function () {
                    $(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
                });
                ;
                //Following events are applied to the trigger (Hover events for the trigger)
            }).hover(function () {
                $(this).addClass("subhover"); //On hover over, add class "subhover"
            }, function () {	//On Hover Out
                $(this).removeClass("subhover"); //On hover out, remove class "subhover"
            });

        });
    </script>
    <style type="text/css">
        .style1
        {
            width: 52px;
        }
        .style2
        {
            height: 30px;
        }
    </style>
</asp:Content>
